/*
 * Created on 2006-1-10
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.dp.tj;

import java.io.OutputStream;
import java.util.List;

import javax.naming.Context;

import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.VerticalAlignment;
import jxl.write.WritableCellFormat;
import jxl.write.WritableSheet;

import com.dp.pub.Page;
import com.dp.util.InterUtil;

/*import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.jdom.Element;

import com.pumc.model.LcDzlz;
import com.pumc.model.LcJhzt;
import com.pumc.model.LcKs;
import com.pumc.model.LcKslzb;
import com.pumc.model.LcXsjh;
import com.pumc.model.*;*/
/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

public class excelrw 
{
    private Context ctx;
   // private Session ss=null;
   // private SessionFactory sf=null;
    private  jxl.write.Label cell=null;
    private  String jhh="";
    private  String jxsx="";
    private  WritableCellFormat cellformat;
    public excelrw()
    {
    	try {
			createCellformat();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
      public excelrw setJH(String jh,String jxs)
      {
          jhh=jh;
          jxsx=jxs;
          return this;
       }
      private excelrw createCellformat() throws Exception 
      {
    	  cellformat = new WritableCellFormat();
  	  	cellformat.setBorder(Border.ALL, BorderLineStyle.THIN);
  	  	cellformat.setAlignment(Alignment.CENTRE);
  	  	cellformat.setVerticalAlignment(VerticalAlignment.CENTRE);
    	  return this;
      }public  void writeIOuserExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
      {         
          jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
          jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.newQuitUser"), 0);
          int row=0;
          int col=0;	
          int maxcol=2+totalcol;
           			//订购数																							
          			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时

         String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
         	InterUtil.rb.getString("src.newQuitUserYear")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
         String[] title1={InterUtil.rb.getString("src.svrName"),InterUtil.rb.getString("src.addOrQuitr"),InterUtil.rb.getString("src.number"),InterUtil.rb.getString("src.totalnew")};						
        //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
          
          addcell(ws,row, col,title,cellformat);
          ws.mergeCells(col,row,col+maxcol,row);
          row++;
          addcell(ws,row, col,title1[0],cellformat);
          addcell(ws,row, col+1,title1[1],cellformat);
          addcell(ws,row, col+2,title1[2],cellformat);
          //addcell(ws,row, col+3,title1[3],cellformat);
          
          addcell(ws,row, col+maxcol,title1[3],cellformat);
          ws.mergeCells(col,row,col,row+1);
          ws.mergeCells(col+1,row,col+1,row+1);
          ws.mergeCells(col+2,row,col+2,row+1);
          //ws.mergeCells(col+3,row,col+3+totalcol,row);
          ws.mergeCells(col+maxcol,row,col+maxcol,row+1);
          row++;
          switch(year.length)
          {
          case 1:
          	 for(col=2;col<maxcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
          	break;
          case 2:
        	  for(col=2;col<maxcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
          	break;
          case 3:
        	  for(col=2;col<maxcol;col++)addcell(ws,row, col,(col-2)+InterUtil.rb.getString("src.point"),cellformat);
          	break;
         	default:
         		break;
          }
          
          	
                 
  	  	 for(List<String> tem:data)
  	  	 {
  	  		 col=0;
  	  		 row++;
  	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
  	      }
          wwb.write();
          wwb.close();
          
        }
      public  void writeUserExcel(OutputStream os,List<List<String>> data,String year) throws Exception 
      {         
        jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
        jxl.write.WritableSheet ws = wwb.createSheet(year+InterUtil.rb.getString("src.srvUserByYear"), 0);
        int row=0;
        int col=0;
        
       String title=year+InterUtil.rb.getString("src.srvUser");														
       String[] title1={InterUtil.rb.getString("src.svrName")," "+InterUtil.rb.getString("src.svrtype"),InterUtil.rb.getString("src.downloadCount"),InterUtil.rb.getString("src.totalnew")};						
      //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
        
        addcell(ws,row, col,title,cellformat);
        ws.mergeCells(col,row,col+14,row);
        row++;
        addcell(ws,row, col,title1[0],cellformat);
        addcell(ws,row, col+1,title1[1],cellformat);
        addcell(ws,row, col+2,title1[2],cellformat);
        addcell(ws,row, col+14,title1[3],cellformat);
        ws.mergeCells(col,row,col,row+1);
        ws.mergeCells(col+1,row,col+1,row+1);
        ws.mergeCells(col+2,row,col+13,row);
        ws.mergeCells(col+14,row,col+14,row+1);
        row++;
        for(col=2;col<14;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
               
	  	 for(List<String> tem:data)
	  	 {
	  		 col=0;
	  		 row++;
	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
	      }
        wwb.write();
        wwb.close();
        
      }
      public  void writeMobileExcel(OutputStream os,List<List<String>> data,String year) throws Exception 
      {         
        jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
        jxl.write.WritableSheet ws = wwb.createSheet(year+InterUtil.rb.getString("src.dlPhoneByYear"), 0);
        int row=0;
        int col=0;
        
       String title=year+InterUtil.rb.getString("src.dlPhone");														
       String[] title1={InterUtil.rb.getString("src.uatype")," "+InterUtil.rb.getString("src.svrtype"),InterUtil.rb.getString("src.downloadCount"),InterUtil.rb.getString("src.totalnew")};						
      //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
        
        addcell(ws,row, col,title,cellformat);
        ws.mergeCells(col,row,col+14,row);
        row++;
        addcell(ws,row, col,title1[0],cellformat);
        addcell(ws,row, col+1,title1[1],cellformat);
        addcell(ws,row, col+2,title1[2],cellformat);
        addcell(ws,row, col+14,title1[3],cellformat);
        ws.mergeCells(col,row,col,row+1);
        ws.mergeCells(col+1,row,col+1,row+1);
        ws.mergeCells(col+2,row,col+13,row);
        ws.mergeCells(col+14,row,col+14,row+1);
        row++;
        for(col=2;col<14;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
               
	  	 for(List<String> tem:data)
	  	 {
	  		 col=0;
	  		 row++;
	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
	      }
        wwb.write();
        wwb.close();
        
      }
      
      public  void writeSPExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
      {         
        jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
        jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.spServiceself"), 0);
        int row=0;
        int col=0;																						
         			//订购数																							
        			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时

       String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
       	InterUtil.rb.getString("src.spServiceselfByYear")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
       String[] title1={InterUtil.rb.getString("src.spname"),InterUtil.rb.getString("src.svrName"),InterUtil.rb.getString("src.dlOrOrder"),InterUtil.rb.getString("src.number"),InterUtil.rb.getString("src.totalnew")};						
      //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
        
        addcell(ws,row, col,title,cellformat);
        ws.mergeCells(col,row,col+3+totalcol,row);
        row++;
        addcell(ws,row, col,title1[0],cellformat);
        addcell(ws,row, col+1,title1[1],cellformat);
        addcell(ws,row, col+2,title1[2],cellformat);
        addcell(ws,row, col+3,title1[3],cellformat);
        
        addcell(ws,row, col+3+totalcol,title1[4],cellformat);
        ws.mergeCells(col,row,col,row+1);
        ws.mergeCells(col+1,row,col+1,row+1);
        ws.mergeCells(col+2,row,col+2,row+1);
        //ws.mergeCells(col+3,row,col+3+totalcol,row);
        ws.mergeCells(col+3+totalcol,row,col+3+totalcol,row+1);
        row++;
        switch(year.length)
        {
        case 1:
        	 for(col=3;col<3+totalcol;col++)addcell(ws,row, col,(col-2)+InterUtil.rb.getString("src.month"),cellformat);
        	break;
        case 2:
        	 for(col=3;col<3+totalcol;col++)addcell(ws,row, col,(col-2)+InterUtil.rb.getString("src.day"),cellformat);
        	break;
        case 3:
       	     for(col=3;col<3+totalcol;col++)addcell(ws,row, col,(col-3)+InterUtil.rb.getString("src.point"),cellformat);
        	break;
       	default:
       		break;
        }
        
        	
               
	  	 for(List<String> tem:data)
	  	 {
	  		 col=0;
	  		 row++;
	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
	      }
        wwb.write();
        wwb.close();
        
      }
      
    //----------------------------1221 wap user order province statistic------------------------
    	public  void writeWapUserOrderProvinceExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
    	{         
    		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
    		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("scr.rpt.wapuserorderProvince"), 0);
    		int row=0;
    		int col=0;																						
    		
    		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
    		InterUtil.rb.getString("scr.rpt.wapuserorderProvinceBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
    		
    		addcell(ws,row, col,title,cellformat);
    		ws.mergeCells(col,row,col+1+totalcol,row);
//    		row++;
    		
//    		String[] title1={InterUtil.rb_jsp.getString("game.content.name"),InterUtil.rb.getString("src.rpt.orderNumber"),InterUtil.rb.getString("src.totalnew")};						
//    		addcell(ws,row, col,title1[0],cellformat);
//    		addcell(ws,row, col+1,title1[1],cellformat);
//    		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
    		
//    		ws.mergeCells(col,row,col,row+1);
//    		ws.mergeCells(col+1,row,col+totalcol,row);
//    		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
//    		row++;
    		switch(year.length)
    		{
    			case 1:
    				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
    				break;
    			case 2:
    				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
    				break;
    			default:
    				break;
    		}
    		for(List<String> tem:data)
    		{
    			col=0;
    			row++;
    			for(String s:tem) addcell(ws,row, col++, s,cellformat);
    		}
    		wwb.write();
    		wwb.close();
      }
    
    //----------------------------1217 wap user order statistic------------------------
  	public  void writeWapUserOrderExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
  		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.channelsAccess"), 0);
  		int row=0;
  		int col=0;																						
  		
  		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
  		InterUtil.rb.getString("scr.rpt.wapuserorderBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
  		String[] title1={InterUtil.rb_jsp.getString("game.content.name"),InterUtil.rb.getString("src.rpt.orderNumber"),InterUtil.rb.getString("src.totalnew")};						
  		
  		addcell(ws,row, col,title,cellformat);
  		ws.mergeCells(col,row,col+1+totalcol,row);
  		row++;
  		addcell(ws,row, col,title1[0],cellformat);
  		addcell(ws,row, col+1,title1[1],cellformat);
  		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
  		
  		ws.mergeCells(col,row,col,row+1);
  		ws.mergeCells(col+1,row,col+totalcol,row);
  		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
  		row++;
  		switch(year.length)
  		{
  			case 1:
  				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
  				break;
  			case 2:
  				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
  				break;
  			default:
  				break;
  		}
  		for(List<String> tem:data)
  		{
  			col=0;
  			row++;
  			for(String s:tem) addcell(ws,row, col++, s,cellformat);
  		}
  		wwb.write();
  		wwb.close();
    }
      
      //----------------------------1012 HdContentsAccess statistic------------------------
  	public  void writePortalContentsAccessExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
  		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.hdPortalChannelAccess"), 0);
  		int row=0;
  		int col=0;																						
  		
  		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
  		InterUtil.rb.getString("src.rpt.portalContentsAccessBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
  		String[] title1={InterUtil.rb_jsp.getString("game.content.name"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
  		
  		addcell(ws,row, col,title,cellformat);
  		ws.mergeCells(col,row,col+1+totalcol,row);
  		row++;
  		addcell(ws,row, col,title1[0],cellformat);
  		addcell(ws,row, col+1,title1[1],cellformat);
  		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
  		
  		ws.mergeCells(col,row,col,row+1);
  		ws.mergeCells(col+1,row,col+totalcol,row);
  		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
  		row++;
  		switch(year.length)
  		{
  			case 1:
  				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
  				break;
  			case 2:
  				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
  				break;
  			default:
  				break;
  		}
  		for(List<String> tem:data)
  		{
  			col=0;
  			row++;
  			for(String s:tem) addcell(ws,row, col++, s,cellformat);
  		}
  		wwb.write();
  		wwb.close();
  	}
  	
    //----------------------------0825 active user------------------------
  	public  void writeActiveUserExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.activeuser"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.rpt.activeuserBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjPlatform"),InterUtil.rb.getString("src.userNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol-1,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
//		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
//		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
      
    //----------------------------0820 HdChannelsAccess statistic------------------------
	public  void writeHdChannelsAccessExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.hdPortalChannelAccess"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.rpt.hdPortalChannelAccessBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.channelName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
	}
      
    //----------------------------0819 wap down statistic------------------------
  	public  void writeWapDownExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
  		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.wapdown"), 0);
  		int row=0;
  		int col=0;																						
  		
  		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
  		InterUtil.rb.getString("src.rpt.wapdownby")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
  		String[] title1={InterUtil.rb_jsp.getString("game.content.name"),InterUtil.rb.getString("src.downloadCount"),InterUtil.rb.getString("src.totalnew")};						
  		addcell(ws,row, col,title,cellformat);
  		ws.mergeCells(col,row,col+1+totalcol,row);
  		row++;
  		addcell(ws,row, col,title1[0],cellformat);
  		addcell(ws,row, col+1,title1[1],cellformat);
  		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
  		
  		ws.mergeCells(col,row,col,row+1);
  		ws.mergeCells(col+1,row,col+totalcol,row);
  		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
  		row++;
  		switch(year.length)
  		{
  			case 1:
  				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
  				break;
  			case 2:
  				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
  				break;
  			default:
  				break;
  		}
  		for(List<String> tem:data)
  		{
  			col=0;
  			row++;
  			for(String s:tem) addcell(ws,row, col++, s,cellformat);
  		}
  		wwb.write();
  		wwb.close();
    }
  	
    //----------------------------0819 iphone day------------------------
  	public  void writeIphoneDayExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
  		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.chlUserFile"), 0);
  		int row=0;
  		int col=0;																						
  		
  		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
  		InterUtil.rb.getString("src.rpt.iphonedayby")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
  		String[] title1={InterUtil.rb.getString("src.rpt.iphoneappname"),InterUtil.rb.getString("src.rpt.iphonevendor"),InterUtil.rb.getString("src.downloadCount"),InterUtil.rb.getString("src.totalnew")};						
  		  //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
  		
  		addcell(ws,row, col,title,cellformat);
  		ws.mergeCells(col,row,col+2+totalcol,row);
  		row++;
  		addcell(ws,row, col,title1[0],cellformat);
  		addcell(ws,row, col+1,title1[1],cellformat);
  		addcell(ws,row, col+2,title1[2],cellformat);
  		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
  		
//  		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
  		ws.mergeCells(col,row,col,row+1);
  		ws.mergeCells(col+1,row,col+1,row+1);
  		ws.mergeCells(col+2,row,col+1+totalcol,row);
  		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
  		row++;
  		switch(year.length)
  		{
  			case 1:
  				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
  				break;
  			case 2:
  				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
  				break;
  			case 3:
  			    for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.point"),cellformat);
  				break;
  			default:
  				break;
  		}
  		for(List<String> tem:data)
  		{
  			col=0;
  			row++;
  			for(String s:tem) addcell(ws,row, col++, s,cellformat);
  		}
  		wwb.write();
  		wwb.close();
    }
      
    //----------------------------0618 k16 link time------------------------
	public  void writeK16LinkTimeExcel(OutputStream os,List<List<String>> data,int totalcol,Page page,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		String str_page="";
		if(page!=null){
			str_page=page.getPageno()+"#"+page.getTotalpage();
		}
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+
				(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+
						(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
						InterUtil.rb.getString("src.rpt.k16linktime")+str_page, 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.rpt.k16linktimeBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.rpt.k16sn"),
				InterUtil.rb.getString("src.rpt.k16phonenumber"),
				InterUtil.rb.getString("src.rpt.k16kdnumber"),
				InterUtil.rb.getString("src.rpt.k16createtime"),
				InterUtil.rb.getString("report.area"),
				InterUtil.rb.getString("src.rpt.usertype"),
				InterUtil.rb_jsp.getString("teldevice.banknumber"),
				InterUtil.rb_jsp.getString("teldevice.servernumber"),
				InterUtil.rb_jsp.getString("teldevice.callcenter"),
				InterUtil.rb_jsp.getString("teldevice.callarea"),
				InterUtil.rb_jsp.getString("teldevice.yyt"),
				InterUtil.rb_jsp.getString("teldevice.servertx"),
				InterUtil.rb_jsp.getString("teldevice.serveraction"),
				InterUtil.rb_jsp.getString("teldevice.priceaction"),
				InterUtil.rb_jsp.getString("teldevice.productname"),
				InterUtil.rb_jsp.getString("teldevice.cname"),
				InterUtil.rb_jsp.getString("teldevice.jx"),
				InterUtil.rb_jsp.getString("teldevice.cstatus"),
				InterUtil.rb_jsp.getString("teldevice.pricename"),
				InterUtil.rb_jsp.getString("teldevice.oktime"),
				InterUtil.rb_jsp.getString("teldevice.note"),
				InterUtil.rb_jsp.getString("teldevice.cempname"),
				InterUtil.rb_jsp.getString("teldevice.caddress"),
				InterUtil.rb_jsp.getString("teldevice.qqh"),
				InterUtil.rb_jsp.getString("teldevice.relationnumber"),
				InterUtil.rb_jsp.getString("teldevice.serverarea"),
				InterUtil.rb_jsp.getString("teldevice.serverqy"),
				InterUtil.rb_jsp.getString("teldevice.xzq"),
				InterUtil.rb_jsp.getString("teldevice.cinfo"),
				InterUtil.rb_jsp.getString("teldevice.ckeyword"),
				InterUtil.rb_jsp.getString("teldevice.creleation"),
				InterUtil.rb_jsp.getString("teldevice.fzman"),
				InterUtil.rb_jsp.getString("teldevice.fzdepartment"),
				InterUtil.rb_jsp.getString("teldevice.validtime"),
				InterUtil.rb_jsp.getString("teldevice.notvalidtime"),
				InterUtil.rb_jsp.getString("teldevice.groupnote"),
				InterUtil.rb_jsp.getString("teldevice.kdsl"),
				InterUtil.rb.getString("src.rpt.k16linktimenumber"),
				InterUtil.rb.getString("src.totalnew")+"("+InterUtil.rb.getString("src.rpt.k16linktimehour")+")"};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+37+totalcol,row);
		row++;
		//sn
		addcell(ws,row, col,title1[0],cellformat);
		//number
		addcell(ws,row, col+1,title1[1],cellformat);
		//kdnumber
		addcell(ws,row, col+2,title1[2],cellformat);
		//createtime
		addcell(ws,row, col+3,title1[3],cellformat);
		//area
		addcell(ws,row, col+4,title1[4],cellformat);
		//usertype
		addcell(ws,row, col+5,title1[5],cellformat);
		//banknumber
		addcell(ws,row, col+6,title1[6],cellformat);
		//servernumber
		addcell(ws,row, col+7,title1[7],cellformat);
		//callcenter
		addcell(ws,row, col+8,title1[8],cellformat);
		//callarea
		addcell(ws,row, col+9,title1[9],cellformat);
		//yyt
		addcell(ws,row, col+10,title1[10],cellformat);
		//servertx
		addcell(ws,row, col+11,title1[11],cellformat);
		//serveraction
		addcell(ws,row, col+12,title1[12],cellformat);
		//priceaction
		addcell(ws,row, col+13,title1[13],cellformat);
		//productname
		addcell(ws,row, col+14,title1[14],cellformat);
		//cname
		addcell(ws,row, col+15,title1[15],cellformat);
		//jx
		addcell(ws,row, col+16,title1[16],cellformat);
		//cstatus
		addcell(ws,row, col+17,title1[17],cellformat);
		//pricename
		addcell(ws,row, col+18,title1[18],cellformat);
		//oktime
		addcell(ws,row, col+19,title1[19],cellformat);
		//note
		addcell(ws,row, col+20,title1[20],cellformat);
		//cempname
		addcell(ws,row, col+21,title1[21],cellformat);
		//caddress
		addcell(ws,row, col+22,title1[22],cellformat);
		//qqh
		addcell(ws,row, col+23,title1[23],cellformat);
		//relationnumber
		addcell(ws,row, col+24,title1[24],cellformat);
		//serverarea
		addcell(ws,row, col+25,title1[25],cellformat);
		//serverqy
		addcell(ws,row, col+26,title1[26],cellformat);
		//xzq
		addcell(ws,row, col+27,title1[27],cellformat);
		//cinfo
		addcell(ws,row, col+28,title1[28],cellformat);
		//ckeyword
		addcell(ws,row, col+29,title1[29],cellformat);
		//creleation
		addcell(ws,row, col+30,title1[30],cellformat);
		//fzman
		addcell(ws,row, col+31,title1[31],cellformat);
		//fzdepartment
		addcell(ws,row, col+32,title1[32],cellformat);
		//validtime
		addcell(ws,row, col+33,title1[33],cellformat);
		//notvalidtime
		addcell(ws,row, col+34,title1[34],cellformat);
		//groupnote
		addcell(ws,row, col+35,title1[35],cellformat);
		//kdsl
		addcell(ws,row, col+36,title1[36],cellformat);
		//6linktimenumber
		addcell(ws,row, col+37,title1[37],cellformat);
		//total
		addcell(ws,row, col+37+totalcol,title1[38],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+2,row+1);
		ws.mergeCells(col+3,row,col+3,row+1);
		ws.mergeCells(col+4,row,col+4,row+1);
		ws.mergeCells(col+5,row,col+5,row+1);
		ws.mergeCells(col+6,row,col+6,row+1);
		ws.mergeCells(col+7,row,col+7,row+1);
		ws.mergeCells(col+8,row,col+8,row+1);
		ws.mergeCells(col+9,row,col+9,row+1);
		ws.mergeCells(col+10,row,col+10,row+1);
		ws.mergeCells(col+11,row,col+11,row+1);
		ws.mergeCells(col+12,row,col+12,row+1);
		ws.mergeCells(col+13,row,col+13,row+1);
		ws.mergeCells(col+14,row,col+14,row+1);
		ws.mergeCells(col+15,row,col+15,row+1);
		ws.mergeCells(col+16,row,col+16,row+1);
		ws.mergeCells(col+17,row,col+17,row+1);
		ws.mergeCells(col+18,row,col+18,row+1);
		ws.mergeCells(col+19,row,col+19,row+1);
		ws.mergeCells(col+20,row,col+20,row+1);
		ws.mergeCells(col+21,row,col+21,row+1);
		ws.mergeCells(col+22,row,col+22,row+1);
		ws.mergeCells(col+23,row,col+23,row+1);
		ws.mergeCells(col+24,row,col+24,row+1);
		ws.mergeCells(col+25,row,col+25,row+1);
		ws.mergeCells(col+26,row,col+26,row+1);
		ws.mergeCells(col+27,row,col+27,row+1);
		ws.mergeCells(col+28,row,col+28,row+1);
		ws.mergeCells(col+29,row,col+29,row+1);
		ws.mergeCells(col+30,row,col+30,row+1);
		ws.mergeCells(col+31,row,col+31,row+1);
		ws.mergeCells(col+32,row,col+32,row+1);
		ws.mergeCells(col+33,row,col+33,row+1);
		ws.mergeCells(col+34,row,col+34,row+1);
		ws.mergeCells(col+35,row,col+35,row+1);
		ws.mergeCells(col+36,row,col+36,row+1);
		
		//blank
		ws.mergeCells(col+37,row,col+37+totalcol-1,row);
		ws.mergeCells(col+37+totalcol,row,col+37+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=37;col<37+totalcol;col++)addcell(ws,row, col,(col-36)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=37;col<37+totalcol;col++)addcell(ws,row, col,(col-36)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
	}
      
      
      //----------------------------0317 platform user------------------------
	public  void writePltUserExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.pltUserFile"), 0);
		int row=0;
		int col=0;																						
			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.pltUserFileBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjPlatform"),InterUtil.rb.getString("src.tjIparea"),InterUtil.rb.getString("src.userNumber"),InterUtil.rb.getString("src.totalnew")};						
		  //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+2+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
		
//		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+1+totalcol,row);
		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			case 3:
			    for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.point"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
      
	
	//----------------------------0318 channel platform user------------------------
	public  void writeChlUserExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.chlUserFile"), 0);
		int row=0;
		int col=0;																						
			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.chlUserFileBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjPlatform"),InterUtil.rb.getString("src.tjChannel"),InterUtil.rb.getString("src.userNumber"),InterUtil.rb.getString("src.totalnew")};						
		  //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+2+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
		
//		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+1+totalcol,row);
		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			case 3:
			    for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.point"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------0322 channel access statistic------------------------
	public  void writeChannelsAccessExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.channelsAccess"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.channelsAccessBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.channelName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------0706 channel ad access statistic------------------------
	public  void writeChannelAdsAccessExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.adsAccess"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.adsAccessBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.adName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------0323 ad access statistic------------------------
	public  void writeAdsAccessExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.adsAccess"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.adsAccessBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.adName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------20110720 ad click statistic------------------------
	public  void writeAdsClickExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.adsClick"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.adsClickBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.adName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------0324 top twenty statistic------------------------
	public  void writeTopTwentyExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.contentsTopTwenty"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.contentsTopTwentyBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb_jsp.getString("game.content.name"),
				InterUtil.rb_jsp.getString("newspaper.source"),
				InterUtil.rb.getString("src.contype"),
				InterUtil.rb.getString("src.accessNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------20110221 constopbyarea statistic------------------------
	public  void writeConstopbyareaExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.constopbyareaBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.constopbyareaBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb_jsp.getString("game.content.name"),
				InterUtil.rb_jsp.getString("newspaper.source"),
				InterUtil.rb.getString("src.contype"),
				InterUtil.rb.getString("src.tjIparea"),
				InterUtil.rb_jsp.getString("game.craetor"),
				InterUtil.rb.getString("src.accessNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------20110222 adaccessbyarea statistic------------------------
	public  void writeAdaccessbyareaExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.adaccessbyareaBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.adaccessbyareaBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb_jsp.getString("ads.adtitle"),
				InterUtil.rb.getString("src.tjIparea"),
				InterUtil.rb.getString("src.accessNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------20110223 channelaccess Top statistic------------------------
	public  void writeChannelaccessTopExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.channelaccesstopBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.channelaccesstopBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb_jsp.getString("service.channel.name"),
				InterUtil.rb.getString("src.accessNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110223 chaccess Single statistic------------------------
	public  void writeChaccessSingleExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.chaccesssingleBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.chaccesssingleBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.channelName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110223 consaccess single statistic------------------------
	public  void writeConsaccessSingleExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.consaccesssingleBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.consaccesssingleBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb_jsp.getString("game.content.name"),
				InterUtil.rb_jsp.getString("newspaper.source"),
				InterUtil.rb.getString("src.contype"),
				InterUtil.rb_jsp.getString("game.craetor"),
				InterUtil.rb.getString("src.accessNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
	//----------------------------20110224  shareuse statistic------------------------
	public  void writeK16appaccessExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.k16appaccessBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.k16appaccessBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.k16appname"),"","",InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+2+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+2,row,col+1+totalcol,row);
		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		int i=0;
		for(List<String> tem:data)
		{
			col=0;
			row++;
			if(i%2!=0){
				col++;
			}
			i++;
			for(String s:tem){
				if(col==0){
					addcell(ws,row, col++, s,cellformat);
					ws.mergeCells(0,row,0,row+1);
				}else{
					addcell(ws,row, col++, s,cellformat);
				}
			} 
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110224  shareuse statistic------------------------
	public  void writeShareuseExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.shareuseBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.shareuseBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb_jsp.getString("game.platform"),InterUtil.rb.getString("src.usenumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110224  k16 receivefile statistic------------------------
	public  void writeK16receivefileExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.k16receivefileBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.k16receivefileBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={"","",InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row);
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110224  msgarrival statistic------------------------
	public  void writeMsgarrivalExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.msgarrivalBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.msgarrivalBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb_jsp.getString("sysmsg.tcatam"),InterUtil.rb.getString("src.msgarrival.arrivenumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110224  msgarrival statistic------------------------
	public  void writeMsgreadExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.msgreadBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.msgreadBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb_jsp.getString("sysmsg.tcatam"),InterUtil.rb.getString("src.msgread.readnumber"),InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+1+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+1+totalcol,title1[2],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+totalcol,row);
		ws.mergeCells(col+1+totalcol,row,col+1+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=1;col<1+totalcol;col++)addcell(ws,row, col,col+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110228  k16 avgtime statistic------------------------
	public  void writeK16avgtimeExcel(OutputStream os,List<List<String>> data,int totalcol,String titleBy,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+titleBy, 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		titleBy+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjIparea"),"","",InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+2+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+1+totalcol,row);
		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		int i=0;
		for(List<String> tem:data)
		{
			col=0;
			row++;
			if(i%5!=0){
				col++;
			}
			i++;
			for(String s:tem){
				if(col==0){
					addcell(ws,row, col++, s,cellformat);
					ws.mergeCells(0,row,0,row+4);
				}else{
					addcell(ws,row, col++, s,cellformat);
				}
			} 
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110228  k16 browsertime statistic------------------------
	public  void writeK16browsertimeExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.k16browsertimeBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.k16browsertimeBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjIparea"),"","",InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+2+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+1+totalcol,row);
		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------20110408  k16 adscalltime statistic------------------------
	public  void writeK16adscalltimeExcel(OutputStream os,List<List<String>> data,int totalcol,String titleBy,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+titleBy, 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		titleBy+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjIparea"),InterUtil.rb.getString("src.k16adscalltime.callnumber"),"","",InterUtil.rb.getString("src.totalnew")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+3+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+3,title1[3],cellformat);
		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
		
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+2,row+1);
		ws.mergeCells(col+3,row,col+2+totalcol,row);
		ws.mergeCells(col+3+totalcol,row,col+3+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=3;col<3+totalcol;col++)addcell(ws,row, col,(col-2)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=3;col<3+totalcol;col++)addcell(ws,row, col,(col-2)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem){
				if((row+2)%5==0){
					addcell(ws,row, col, s,cellformat);
					if(col<=1){
						ws.mergeCells(col,row,col,row+4);
					}else{
						addcell(ws,row, col, s,cellformat);
					}
				}else{
					addcell(ws,row, col+2, s,cellformat);
				}
				col++;
			} 
		}
		wwb.write();
		wwb.close();
    }
	
	//----------------------------0324 channel new user------------------------
	public  void writeChlNewUserExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
	{         
		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.chlNewUserForReport"), 0);
		int row=0;
		int col=0;																						
			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.chlNewUserForReportBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.tjPlatform"),InterUtil.rb.getString("src.tjChannel"),InterUtil.rb.getString("src.userNumber"),InterUtil.rb.getString("src.totalnew")};						
		  //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+2+totalcol,row);
		row++;
		addcell(ws,row, col,title1[0],cellformat);
		addcell(ws,row, col+1,title1[1],cellformat);
		addcell(ws,row, col+2,title1[2],cellformat);
		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
		
//		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
		ws.mergeCells(col,row,col,row+1);
		ws.mergeCells(col+1,row,col+1,row+1);
		ws.mergeCells(col+2,row,col+1+totalcol,row);
		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
		row++;
		switch(year.length)
		{
			case 1:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
				break;
			case 2:
				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
				break;
			case 3:
			    for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.point"),cellformat);
				break;
			default:
				break;
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
      }
	
      public  void writeLASExcel(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
      {         
        jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
        jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+"流量分析统计", 0);
        int row=0;
        int col=0;																						
         			//订购数																							
        			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时

       String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
       	"流量分析统计（按"+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
       String[] title1={"地区","运营商","点击量",InterUtil.rb.getString("src.totalnew")};						
      //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
        addcell(ws,row, col,title,cellformat);
        ws.mergeCells(col,row,col+2+totalcol,row);
        row++;
        addcell(ws,row, col,title1[0],cellformat);    //地区
        addcell(ws,row, col+1,title1[1],cellformat);  //运营商
        addcell(ws,row, col+2,title1[2],cellformat);  //点击量
        addcell(ws,row, col+2+totalcol,title1[3],cellformat);   //总计
        ws.mergeCells(col,row,col,row+1);
        ws.mergeCells(col+1,row,col+1,row+1);
        ws.mergeCells(col+2,row,col+1+totalcol,row);
        ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
        row++;
        switch(year.length)
        {
        case 1:
        	 for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
        	break;
        case 2:
        	 for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
        	break;
        case 3:
       	     for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-2)+InterUtil.rb.getString("src.point"),cellformat);
        	break;
       	default:
       		break;
        }
        
        	
	  	 for(List<String> tem:data)
	  	 {
	  		 col=0;
	  		 row++;
	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
	      }
        wwb.write();
        wwb.close();
      }
      
      public  void writeICExcel(OutputStream os,List<List<String>> data,String year) throws Exception 
      {         
        jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
        jxl.write.WritableSheet ws = wwb.createSheet(year+InterUtil.rb.getString("src.srvRenStruByYear"), 0);
        int row=0;
        int col=0;
        
       String title=year+InterUtil.rb.getString("src.javaDlStruByMonth");														
       String[] title1={InterUtil.rb.getString("src.contype")," "+InterUtil.rb.getString("src.svrtype"),InterUtil.rb.getString("src.revenue"),InterUtil.rb.getString("src.totalnew")};						
      //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
        
        addcell(ws,row, col,title,cellformat);
        ws.mergeCells(col,row,col+14,row);
        row++;
        addcell(ws,row, col,title1[0],cellformat);
        addcell(ws,row, col+1,title1[1],cellformat);
        addcell(ws,row, col+2,title1[2],cellformat);
        addcell(ws,row, col+14,title1[3],cellformat);
        ws.mergeCells(col,row,col,row+1);
        ws.mergeCells(col+1,row,col+1,row+1);
        ws.mergeCells(col+2,row,col+13,row);
        ws.mergeCells(col+14,row,col+14,row+1);
        row++;
        for(col=2;col<14;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
               
	  	 for(List<String> tem:data)
	  	 {
	  		 col=0;
	  		 row++;
	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
	      }
        wwb.write();
        wwb.close();
        
      }
      public  void writeIAExcel(OutputStream os,List<List<String>> data,String year) throws Exception 
      {         
        jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
        jxl.write.WritableSheet ws = wwb.createSheet(year+InterUtil.rb.getString("src.srvRenByYear"), 0);
        int row=0;
        int col=0;
        
       String title=year+InterUtil.rb.getString("src.javaDlByMonth");														
       String[] title1={InterUtil.rb.getString("src.provice")," "+InterUtil.rb.getString("src.svrtype"),InterUtil.rb.getString("src.revenue"),InterUtil.rb.getString("src.totalnew")};						
      //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
        
        addcell(ws,row, col,title,cellformat);
        ws.mergeCells(col,row,col+14,row);
        row++;
        addcell(ws,row, col,title1[0],cellformat);
        addcell(ws,row, col+1,title1[1],cellformat);
        addcell(ws,row, col+2,title1[2],cellformat);
        addcell(ws,row, col+14,title1[3],cellformat);
        ws.mergeCells(col,row,col,row+1);
        ws.mergeCells(col+1,row,col+1,row+1);
        ws.mergeCells(col+2,row,col+13,row);
        ws.mergeCells(col+14,row,col+14,row+1);
        row++;
        for(col=2;col<14;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
               
	  	 for(List<String> tem:data)
	  	 {
	  		 col=0;
	  		 row++;
	  		 for(String s:tem) addcell(ws,row, col++, s,cellformat);
	      }
	  
        /*jxl.write.WritableFont wfc = new jxl.write.WritableFont(WritableFont.ARIAL,20, WritableFont.BOLD, false,
                UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.GREEN);
            jxl.write.WritableCellFormat wcfFC = new jxl.write.WritableCellFormat(wfc);
            wcfFC.setBackground(jxl.format.Colour.RED);
            cell = new jxl.write.Label(6, 0, "�й���",wcfFC);
            */        
             
        wwb.write();
        wwb.close();
        
      }
      
      
    //add 20110830
    //----------------------------channel access by playform------------------------
  	public  void writeChsAccessByPlatform(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
  		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.chsAccessByPlatform"), 0);
  		int row=0;
  		int col=0;																						
  			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时
  		
  		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
  		InterUtil.rb.getString("src.rpt.chsAccessByPlatformBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
  		String[] title1={InterUtil.rb.getString("src.tjPlatform"),InterUtil.rb.getString("src.channelName"),InterUtil.rb.getString("src.accessNumber"),InterUtil.rb.getString("src.totalnew")};						
  		  //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
  		
  		addcell(ws,row, col,title,cellformat);
  		ws.mergeCells(col,row,col+2+totalcol,row);
  		row++;
  		addcell(ws,row, col,title1[0],cellformat);
  		addcell(ws,row, col+1,title1[1],cellformat);
  		addcell(ws,row, col+2,title1[2],cellformat);
  		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
  		
//  		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
  		ws.mergeCells(col,row,col,row+1);
  		ws.mergeCells(col+1,row,col+1,row+1);
  		ws.mergeCells(col+2,row,col+1+totalcol,row);
  		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
  		row++;
  		switch(year.length)
  		{
  			case 1:
  				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
  				break;
  			case 2:
  				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
  				break;
  			case 3:
  			    for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.point"),cellformat);
  				break;
  			default:
  				break;
  		}
  		for(List<String> tem:data)
  		{
  			col=0;
  			row++;
  			for(String s:tem) addcell(ws,row, col++, s,cellformat);
  		}
  		wwb.write();
  		wwb.close();
      }
  	
  	//----------------------------channel client by playform------------------------
  	public  void writeChsClientByPlatform(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
  		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.chsClientByPlatform"), 0);
  		int row=0;
  		int col=0;																						
  			//0时	1时	2时	3时	4时	5时	6时	7时	8时	9时	10时	11时	12时	13时	14时	15时	16时	17时	18时	19时	20时	21时	22时	23时
  		
  		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
  		InterUtil.rb.getString("src.rpt.chsClientByPlatformBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
  		String[] title1={InterUtil.rb.getString("src.tjPlatform"),InterUtil.rb.getString("src.channelName"),InterUtil.rb.getString("src.clientNumber"),InterUtil.rb.getString("src.totalnew")};						
  		  //  	1月	2月	3月	4月	5月	6月	7月	8月	9月	10月	11月	12月	
  		
  		addcell(ws,row, col,title,cellformat);
  		ws.mergeCells(col,row,col+2+totalcol,row);
  		row++;
  		addcell(ws,row, col,title1[0],cellformat);
  		addcell(ws,row, col+1,title1[1],cellformat);
  		addcell(ws,row, col+2,title1[2],cellformat);
  		addcell(ws,row, col+2+totalcol,title1[3],cellformat);
  		
//  		addcell(ws,row, col+3+totalcol,title1[4],cellformat);
  		ws.mergeCells(col,row,col,row+1);
  		ws.mergeCells(col+1,row,col+1,row+1);
  		ws.mergeCells(col+2,row,col+1+totalcol,row);
  		ws.mergeCells(col+2+totalcol,row,col+2+totalcol,row+1);
  		row++;
  		switch(year.length)
  		{
  			case 1:
  				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.month"),cellformat);
  				break;
  			case 2:
  				for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.day"),cellformat);
  				break;
  			case 3:
  			    for(col=2;col<2+totalcol;col++)addcell(ws,row, col,(col-1)+InterUtil.rb.getString("src.point"),cellformat);
  				break;
  			default:
  				break;
  		}
  		for(List<String> tem:data)
  		{
  			col=0;
  			row++;
  			for(String s:tem) addcell(ws,row, col++, s,cellformat);
  		}
  		wwb.write();
  		wwb.close();
      }
    
  	//content access bt platform
  	public  void writeConsAccessByPlatform(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.consAccessByPlatformBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.rpt.consAccessByPlatformBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb.getString("src.tjPlatform"),
				InterUtil.rb_jsp.getString("game.content.name"),
				InterUtil.rb_jsp.getString("newspaper.source"),
				InterUtil.rb.getString("src.contype"),
				InterUtil.rb.getString("src.accessNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
  	}
  	
  	public  void writeConsClientByPlatform(OutputStream os,List<List<String>> data,int totalcol,String... year) throws Exception 
  	{         
  		jxl.write.WritableWorkbook wwb = Workbook.createWorkbook(os);
		jxl.write.WritableSheet ws = wwb.createSheet(year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+InterUtil.rb.getString("src.rpt.consClientByPlatformBy"), 0);
		int row=0;
		int col=0;																						
		
		String title=year[0]+InterUtil.rb.getString("src.year")+(year.length>1?(year[1]+InterUtil.rb.getString("src.month")+(year.length>2?(year[2]+InterUtil.rb.getString("src.day")):"")):"")+
		InterUtil.rb.getString("src.rpt.consClientByPlatformBy")+InterUtil.rb.getString("src.yearmd").substring(year.length-1, year.length)+")";														
		String[] title1={InterUtil.rb.getString("src.timeForReport"),
				InterUtil.rb.getString("src.tjPlatform"),
				InterUtil.rb_jsp.getString("game.content.name"),
				InterUtil.rb_jsp.getString("newspaper.source"),
				InterUtil.rb.getString("src.contype"),
				InterUtil.rb.getString("src.clientNumber")};						
		
		addcell(ws,row, col,title,cellformat);
		ws.mergeCells(col,row,col+title1.length-1,row);
		row++;
		for(int i=0;i<title1.length;i++)
		{
			addcell(ws,row, col+i,title1[i],cellformat);
		}
		for(List<String> tem:data)
		{
			col=0;
			row++;
			for(String s:tem) addcell(ws,row, col++, s,cellformat);
		}
		wwb.write();
		wwb.close();
  	}
  	
      private jxl.write.Label createCell(int r,int c,String s)
      {
         return new jxl.write.Label(c, r, s);
       }
      private void addcell(WritableSheet ws,int r,int c,String s,WritableCellFormat cellformat) throws Exception
      {
          ws.addCell(new jxl.write.Label(c, r, s,cellformat));
       }
      private excelrw createFZ(WritableSheet ws) throws Exception
      {
      

         return this; 
         
      }/*
      private excelrw createDZ(WritableSheet ws) throws Exception
      {
        WritableCellFormat cellformat = new WritableCellFormat();
  	  	cellformat.setBorder(Border.ALL, BorderLineStyle.THIN);
  	  	cellformat.setAlignment(Alignment.CENTRE);
  	  	cellformat.setVerticalAlignment(VerticalAlignment.CENTRE);
	  	    Query q3=ss.createQuery("from LcDzlz as a where a.lcDzlzPk.jhh=:jhh and  a.lcDzlzPk.jxsx=:jxsx");
	  	    q3.setString("jhh",jhh);
		    q3.setString("jxsx",jxsx);
	  	    List st1=q3.list();
	  	  String group="һ�����������߰˾�ʮ";
	  	  int dzs=0;
	  	  //int jds=0;
	  	    for(int j=0;j<st1.size();j++)
		    {
		    	 LcDzlz tdzlz=(LcDzlz)st1.get(j);
		    	String ksm= tdzlz.getLcKs().getKsm();
		    	   int dzh=tdzlz.getLcDzlzPk().getDzh();
		    	   int jdh=tdzlz.getJdh();
		    	   String ksrq=tdzlz.getKsrq();
		    	   String jsrq=tdzlz.getJsrq();
		    	   addcell(ws,jdh+1, dzh+3,ksm,cellformat);
		    	   addcell(ws,jdh+1, 1,ksrq,cellformat);
		    	   addcell(ws,jdh+1, 2,jsrq,cellformat);
		    	   dzs=Math.max(dzs,dzh);
		    	  // jds=Math.max(jds,jdh);
		      }
	  	     for(int i=0;i<dzs+1;i++)
	  	     {
	  	         addcell(ws,0, i+3,"��"+group.substring(i,i+1)+"��",cellformat);
	  	         addcell(ws,i+1,0,String.valueOf(i+1),cellformat);
	  	     }
	  	   addcell(ws,0,0,"�׶�",cellformat);
	  	   addcell(ws,0,1,"��ʼʱ��",cellformat);
	  	   addcell(ws,0,2,"����ʱ��",cellformat);
	         	     
	       return this;       
      }
      private excelrw createKSLZB(WritableSheet ws) throws Exception
      {
          
	  	    WritableCellFormat cellformat = new WritableCellFormat();
		  	cellformat.setBorder(Border.ALL, BorderLineStyle.THIN);
		  	cellformat.setAlignment(Alignment.CENTRE);
		  	cellformat.setVerticalAlignment(VerticalAlignment.CENTRE);
        Query q1=ss.createQuery("from LcKs as a where a.lcKsPk.ksh<>:ksh and a.sjks=:sjks");
  	    q1.setString("ksh","000");
  	    q1.setString("sjks","000");
  	    List st=q1.list();
  	    int jds=st.size();
  	    int row=2;
  	    String sql="";
  	    Connection con=ss.connection();
        PreparedStatement prep=null;
        ResultSet rs=null;
  	    for(int i=0;i<st.size();i++)//�Զ�������ѭ��
  	    {    
  	        String ejksh=((LcKs)st.get(i)).getLcKsPk().getKsh();
  	        String ejksm=((LcKs)st.get(i)).getKsm();
	  	      Map sjkshys=new HashMap();
	  	      Map sjksmys=new HashMap();
	  	      sql=" select distinct ksh,ksm  from lc_ks where sjks='"+ejksh+"' order by ksh";//�����
	          prep=con.prepareStatement(sql);
		      rs=prep.executeQuery();
		      int sjkss=0;
		      while(rs.next())
			  {
	              sjkshys.put(rs.getString(1),String.valueOf(sjkss));//�����ӳ��Ϊ����
	              sjksmys.put(String.valueOf(sjkss),rs.getString(2));
	              sjkss++;	  
			  }
		      rs.close();
		      prep.close();	
		      
		      addcell(ws,row-2, 1,ejksm,cellformat);
		      ws.mergeCells(1,row-2,sjkss+3,row-2);
		      for(int jj=0;jj<sjkss;jj++)	          
		      {
		          addcell(ws,row-1, jj+4,(String)sjksmys.get(String.valueOf(jj)),cellformat);
		          ws.setColumnView(jj+4,24);
		      }
		      addcell(ws,row-1, 1,"�׶�",cellformat);
		      addcell(ws,row-1, 2,"��ʼʱ��",cellformat);
		      addcell(ws,row-1, 3,"����ʱ��",cellformat);
	          
  	        for(int j=0;j<jds;j++)//ÿ��������ҵĽ׶�ѭ��
  	        {
	  	          sql=" select max(sjdh)  from lc_kslzb where jhh='"+jhh+"' and jxsx='" +jxsx+"' and ejksh='"+ejksh+"' and dzh="+j;//�˽׶�ʱ��ֶ���
	  	          prep=con.prepareStatement(sql);
	  		      rs=prep.executeQuery();
	  		      int sjds=0;//ʱ�����
	  		      try {
			  		      while(rs.next())
			  			  {
			  	             sjds=Integer.parseInt(rs.getString(1))+1;
			  			  }
	  		          }catch(Exception ee)
	  		          {
	  		            rs.close();
	  	  		        prep.close();
	  		              continue;//�˴������쳣˵�����������ҡ����׶�û����ת��
	  		          }
	  		      rs.close();
	  		      prep.close();
  	            
  	           Query q4=ss.createQuery("from LcKslzb as a where a.lcKslzbPk.jhh=:jhh and a.lcKslzbPk.jxsx=:jxsx and  a.ejksh=:ejksh and  a.dzh=:jdh  order by a.lcKslzbPk.ks ");
	            q4.setString("jhh",jhh);
	            q4.setString("jxsx",jxsx);
	            q4.setString("ejksh",ejksh);
	            q4.setInteger("jdh",j);
  	            List st2=q4.list();
  	       
	  	          int [][] zrs=new int[sjds][sjkss];
	  		      for(int ii=0;ii<sjds;ii++)
	  		         for(int jj=0;jj<sjkss;jj++)
	  		             zrs[ii][jj]=0;//��¼û��ʱ���ÿ�����������
	  		      int cellnum=15;
	  	         String[][][] fz=new String[sjds][sjkss][cellnum];
	             String [][] sj=new String[sjds][2];
	  	       for(int ii=0;ii<sjds;ii++)
			         for(int jj=0;jj<sjkss;jj++)
	       		       for (int k=0;k<cellnum;k++) 
	           		       fz[ii][jj][k]="";//��ֵ
	      	
	  	        for(int ii=0;ii<st2.size();ii++)
	  	        {
	  	           LcKslzb kslzb=(LcKslzb)st2.get(ii);
	  	           int i_sjjd=kslzb.getLcKslzbPk().getSjdh();
	  	           int i_sjks=Integer.parseInt((String)sjkshys.get(kslzb.getLcKslzbPk().getKs()));
	  	           fz[i_sjjd][i_sjks][zrs[i_sjjd][i_sjks]]=kslzb.getLcKslzbPk().getXh()+"_"+kslzb.getXjXjb().getXm();
	  	           zrs[i_sjjd][i_sjks]++;
	  	           sj[i_sjjd][0]=kslzb.getKsrq();
	  	           sj[i_sjjd][1]=kslzb.getJsrq();
	  	 	    }
	  	        
	  	      //д��excel
	  	      for(int ii=0;ii<sjds;ii++)
	  		         for(int jj=0;jj<sjkss;jj++)
			             zrs[ii][0]=Math.max(zrs[ii][0],zrs[ii][jj]);
	  	      int jdqsrow=row;
		         for(int ii=0;ii<sjds;ii++)
		         {
		                for(int jj=0;jj<sjkss;jj++)
			             for (int k=0;k<zrs[ii][0];k++)
			             {
		                      addcell(ws,row+k, jj+4, fz[ii][jj][k],cellformat);
			             }
			         addcell(ws,row, 2,sj[ii][0],cellformat);
			         addcell(ws,row, 3,sj[ii][0],cellformat);
			         addcell(ws,row, 1,String.valueOf(j+1),cellformat);
			         ws.mergeCells(2,row,2,row+zrs[ii][0]-1);
			         ws.mergeCells(3,row,3,row+zrs[ii][0]-1);
			         
			         row+=zrs[ii][0];	         
			      }
		         ws.mergeCells(1,jdqsrow,1,row-1);		         
		         row+=2;
	         }
  	        row+=4;//���Ҽ��4��
  	    }
  	    con.close();
  	    
          return this;       
      }
      private excelrw createKCB(WritableSheet ws) throws Exception
      {
	          WritableCellFormat cellformat = new WritableCellFormat();
			  	cellformat.setBorder(Border.ALL, BorderLineStyle.THIN);
			  	cellformat.setAlignment(Alignment.CENTRE);
			  	cellformat.setVerticalAlignment(VerticalAlignment.CENTRE);
	      Query q1=ss.createQuery("from LcKs as a where a.lcKsPk.ksh<>:ksh and a.sjks=:sjks");
		    q1.setString("ksh","000");
		    q1.setString("sjks","000");
		    List st=q1.list();
		    int jds=st.size();
		    int row=2;
		    String [] lt={"�ܴ�","����","��ʼʱ��","����ʱ��","�Ͽεص�","�γ����","�Ͽ�����","ѧʱ","ѧ��","�Ͽν�ʦ","�Ͽ�����","�Ͽζ���","�Ͽ�����","��ע"};
		    String [] ls=new String[lt.length];
		   
		    for(int i=0;i<st.size();i++)//�Զ�������ѭ��
		    {    
		        String ejksh=((LcKs)st.get(i)).getLcKsPk().getKsh();
		        String ejksm=((LcKs)st.get(i)).getKsm();
			     addcell(ws,row-2, 1,ejksm,cellformat);
			     ws.mergeCells(1,row-2,lt.length+1,row-2);
		         addcell(ws,row-1, 1,"�׶�",cellformat);
			      for(int jj=0;jj<lt.length;jj++)	          
			      {
			          addcell(ws,row-1, jj+2,lt[jj],cellformat);
			          ws.setColumnView(jj+2,18);
			      }
			    
		         
		        for(int j=0;j<jds;j++)//ÿ��������ҵĽ׶�ѭ��
		        {   	            
		           Query q4=ss.createQuery("from LcKcapb as a where a.lcKcapbPk.jhh=:jhh and a.lcKcapbPk.jxsx=:jxsx and  a.lcKcapbPk.ks=:ejksh and  a.lcKcapbPk.jdh=:jdh  order by a.lcKcapbPk.sjdh ");
		            q4.setString("jhh",jhh);
		            q4.setString("jxsx",jxsx);
		            q4.setString("ejksh",ejksh);
		            q4.setInteger("jdh",j);
		            List st2=q4.list();
		            int jdqsrow=row;
		            if (st2.size()>0)
		            {
			  	        for(int ii=0;ii<st2.size();ii++)
			  	        {
			  	            //д��excel
			  	            LcKcapb kcapb=(LcKcapb)st2.get(ii);
			  	            ls[0]=String.valueOf(kcapb.getZc());
			  	            ls[1]=kcapb.getRq();
			  	            ls[2]=kcapb.getKssj();
			  	            ls[3]=kcapb.getJssj();
			  	            ls[4]=kcapb.getDd();
			  	            ls[5]=kcapb.getCodeKcb().getKcm();
			  	            ls[6]=kcapb.getNr();
						  	ls[7]=kcapb.getXs().toString();
						  	ls[8]=kcapb.getXf().toString();
						  	ls[9]=kcapb.getCodeJsb().getJsm();
						  	ls[10]=kcapb.getSkyy();
						  	ls[11]=kcapb.getSkdx();
						  	ls[12]=String.valueOf(kcapb.getXsrs());
						  	ls[13]=kcapb.getBz();
			  	            for (int k=0;k<ls.length;k++)
			  	            addcell(ws,row, k+2,ls[k],cellformat);
			  	            row++;
			  	        }
			  	         addcell(ws,jdqsrow, 1,String.valueOf(j+1),cellformat);
				         ws.mergeCells(1,jdqsrow,1,row-1);		         
				         row+=2;
			         }
		         }
		        row+=4;//���Ҽ��4��
		    }	   
		    
        return this;
         
      }
      private int getZT()
      {
          	
          Query q1= ss.createQuery("from LcJhzt as a where a.lcJhztPk.jhh=:jhh and  a.lcJhztPk.jxsx=:jxsx ");
	  	  q1.setString("jhh",jhh);
	  	  q1.setString("jxsx",jxsx);
	      List li1=q1.list();
	      Query q2= ss.createQuery("select distinct a.lcKslzbPk.jhh from LcKslzb as a where a.lcKslzbPk.jhh=:jhh and  a.lcKslzbPk.jxsx=:jxsx ");
		  q2.setString("jhh",jhh);
		  q2.setString("jxsx",jxsx);
		  Iterator it=q2.list().iterator();		  
		  Query q3= ss.createQuery("select distinct a.lcKcapbPk.jhh from LcKcapb as a where a.lcKcapbPk.jhh=:jhh and  a.lcKcapbPk.jxsx=:jxsx ");
		  q3.setString("jhh",jhh);
		  q3.setString("jxsx",jxsx);
		  Iterator it1=q3.list().iterator();
		  
	 		String jhzt="";		
			
	  		if(li1.size()>0)
	  		{
	  			      LcJhzt tem=(LcJhzt)li1.get(0);
	  			      jhzt=tem.getZzt();
	  			      if(jhzt==null) return 0;
	  			      jhzt=tem.getDzlzzt();
	  			      if(jhzt==null) return 1;
	  			      if(!it.hasNext()) return 2;
	  			      if(!it1.hasNext()) return 3;
	  		}
	  		else
	  		{
	  		  return 0;      
	  		} 
	  		return 4;
          
      }
      */
}



